#import <Foundation/Foundation.h>

typedef enum _HPDelegateResponseMask {
	HPNoResponseMask = 0x00,
	HPStartElementResponseMask = 0x01,
	HPEndElementResponseMask = 0x02,
	HPTextResponseMask = 0x04
} HPDelegateResponseMask;

@interface HParser: NSObject
{
	NSString *contents;

	BOOL usePath;
	NSString *path;

	HPDelegateResponseMask responseMask;

	id delegate;
}
- (id) initWithContentsOfFile: (NSString *) file;

- (void) setDelegate: (id) delegate;
- (id) delegate;

/* Return /xxx/yyy style path based on tags. */
- (void) setUsePath: (BOOL) flag;
- (BOOL) usePath;

- (void) parse;
@end

@interface NSObject (Hpricot)
- (void) parser: (HParser *) parser
         foundStartElement: (NSString *) tag
         attributes: (NSDictionary *) attributes
         path: (NSString *) xpath;
- (void) parser: (HParser *) parser
         foundEndElement: (NSString *) tag
         attributes: (NSDictionary *) attributes
         path: (NSString *) xpath;
- (void) parser: (HParser *) parser
         foundText: (NSString *) text
         attributes: (NSDictionary *) attributes
         path: (NSString *) xpath;
@end

